<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<script>
		function go()
		{
			var str="方辉";
			//var str2=escape(str)+"";
			var url="login.do?form.name="+str;
			alert(url);
			window.location.href=url;
		}
	</script>
  </head>
  
  <body>
  
  <a href="#" onclick="go()">测试测试</a>
 结果：<s:property value="form.name"/>
  
  <input TYPE="hidden" name='myname' value="方辉">
  
  <s:form action="login">
  	<s:textfield name="form.id" value="表单的id"></s:textfield>
  	<s:textfield name="form.name" value="表单的name"></s:textfield>
   <s:textfield name="form.sex" value="表单的sex" ></s:textfield>
   
  	<s:textfield name="form.list.stuName" value="表单的list的stuName"></s:textfield>
   <s:textfield name="form.list.monList.monId" value="表单的list的monList的monId"></s:textfield>
  	<s:textfield name="form.list.monList.monName" value="表单的list的monList的monName"></s:textfield>

    
   <s:submit value="Commit" />
   </s:form>
   
      <a href="login.do">去看看</a> <br>
    <a href="login_ajax.do">去看看AJAX</a> <br>
     显示从后台抓过来的数据：<br>
    <s:property value="form.id"/>
    <s:property value="form.name"/>
    <s:property value="form.sex"/>
    <br>
    <s:iterator value="form.list">
    	<s:property value="stuName"/>
    	<br>
    	<s:iterator value="monList">
    		<s:property value="monId"/>
    		<s:property value="monName"/>
    	</s:iterator><br>
    </s:iterator>
    
  </body>
</html>
